﻿<?xml version="1.0" encoding="utf-8" ?>
<DataScripter ConnectionString="Data Source=.;Initial Catalog=TD;Integrated Security=True"
              Simulate="False"
              OutputPath="OutputScript.SQL"
              IfRecordExists="Skip"
              XmlInterpreter="DataScripter.UI.Old.XmlEngineConfiguratorv2, DataScripter.UI.Old">

  <DataProducer Name="dp" Type="DataScripter.Scripting.Query.SqlServer.DataProducer, DataScripter" />
  <OutputProducer Name="op" Type="DataScripter.Scripting.Output.Sql.SqlServer.SkipIfExistsElseInsertOutputProducer, DataScripter" />
  <Db Name="Db" Type="DataScripter.Database.SqlServer.SqlServerDb, DataScripter" />
  <DatabaseStructure Name="ds" Type="DataScripter.Database.SqlServer.SqlServerDatabaseStructure, DataScripter" />

  <ScriptRequest>
    <!-- Where can also be specified as an attribute-->
    <Table Name="TermAccountActor">
      <Where Clause="ActorID IN (select ActorID from Actor where CustomerNumber=274042)" />
      <Lookup Name="ActorID" LookupTable="Actor" LookupField="CustomerNumber"/>

        <Table Name="TermAccount" >
          <Table Name="Account" >
            <Or>
              <FilterByForeignKey Name="TermAccount_CapitalAccount_FK" />
              <FilterByForeignKey Name="TermAccount_InterestAccount_FK" />
            </Or>
          </Table>
          <Table Name="TermInvestment" />
        </Table>
      
      <Table Name="TermAccountActorHistory" JoinOn="TermAccountActorID" />
      
    </Table>
  </ScriptRequest>

</DataScripter>
